<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta content="IE=8" http-equiv="X-UA-Compatible" />
    <title>{%page_title_add}</title>
    {$QPath}
    <link rel="stylesheet" type="text/css" href="__TMPL__../Admin/Public/base.css" />
    <style type="text/css">
        label.item{margin-left:8px;}
        .popelist{
            float:left;
            margin:3px 6px;
            background-color:#FAFAF6;
            -moz-border-radius:4px;
            border:1px solid #aaaaaa;
            padding:8px 16px;
            width:100p\x;
        }
        .popelist li{
            line-height:20px;
            font-size:12px;
        }
        .popelist .ultitle{
            height:16px;
            line-height:16px;
            font-weight:bold;
            font-size:13px;
            padding-bottom:8px;
        }
        .popelist label{
            color:#545454;
            margin:0;
        }
    </style>
    <script type="text/javascript" src="__TMPL__../Admin/Public/jquery.js"></script>
    <script type="text/javascript" src="__TMPL__../Admin/Public/base.js"></script>
</head>
<body>
    <div id="container">
        <table class="tabmenu" cellspacing="0">
            <tbody>
                <tr>
                    <td style="width:12px">&nbsp;</td>
                    <td style="width:80px"><a href="__URL__/index"><span>{%page_title_index}</span></a></td>
                    <td class="here" style="width:80px"><a href="__URL__/add"><span>{%page_title_add}</span></a></td>
                    <td>&nbsp;</td>
                </tr>
            </tbody>
        </table>
        <div class="main">
            <div class="operate">
                <ul class="fnc">
                    <li>
                        <button type="button" class="btn" onclick="doAction('save')"><span><span>{%save}</span></span></button>
                    </li>
                </ul>
            </div>
            <div class="view">
                <form method="post" action="__URL__">
                    <table class="ips">
                        <tbody>
                            <tr>
                                <th class="essential"><label for="pk1">{%role_name}</label></th>
                                <td>
                                    <input id="pk1" type="text" name="name" maxlength="32" size="40"/ >
                                    <p class="hint">{%role_name_length_limit}</p>
                                </td>
                            </tr>
                            <tr>
                                <th><label>{%role_status}</label></th>
                                <td>
                                    <p><input id="statusOn" type="radio" name="status" value="1" checked /><label for="statusOn" class="item">{%enabled}</label></p>
                                    <p><input id="statusOff" type="radio" name="status" value="0" /><label for="statusOff" class="item">{%disabled}</label></p>
                                </td>
                            </tr>
                            <tr>
                                <th><label>{%popedom}</label></th>
                                <td>
                                    <div>
                                    <iterate name="popelist" id="bundle">
                                        <ul class="popelist">
                                            <li
                                            class="ultitle">{$bundle.name}</li>
                                            <iterate name="bundle['sub']" id="pope">
                                            <li>
                                                <input type="checkbox" name="popedom[]" id="pope{$pope.id}" value="{$pope.id}"/>
                                                <label for="pope{$pope.id}">{$pope.name}</label>
                                            </li>
                                            </iterate>
                                        </ul>
                                        </iterate>
                                    </div>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </form>
            </div>
            <div class="operate">
                <ul class="fnc">
                    <li><button type="button" class="btn" onclick="doAction('save')"><span><span>{%save}</span></span></button></li>
                </ul>
            </div>
        </div>
    </div>
    <script type="text/javascript">
        function doAction(actionType){
            if(!validate([
                        {name:'name',point:[{type:'require',msg:'<?php echo
                        L('v_role_name_require')?>'}],trim:false}
            ])) return;
            $("form").attr("action","__URL__/"+actionType).submit();
        }
    </script>
</body>
</html>
